﻿@using Lari.Configuration
@using Lari.Web.Utility
@model Lari.Services.ViewModel.UserMapModel
<div id="pagetitle">
    <h1>@ScreenName.Users.Activate</h1>
</div>
<div class="spacer">
</div>
<div id="pagecontent">
    <div class="tab">
        Employee Details</div>
    <div class="tabContent">
        @Html.Partial("_EmployeeView", Model.EmployeeModel)
    </div>
    @if (!Model.EmployeeModel.Active)
    {
        using (Html.BeginForm())
        {
            @Html.AntiForgeryToken("activate")
            @Html.HiddenFor(m => m.EmpId)		
					
        
					
            <div class="doubleSpacer">
            </div>
            <div>
                <input type="submit" value="Activate" id="btnActivate" />
            </div>
				
        }

    }
    else
    {
        <div class="spacer">
        </div>  
        @Html.Partial("_DisplyMessaage", MessageCode.User.AllReadyActive)
		 
    }
    <div class="doubleSpacer">
    </div>
    <div>@Html.ActionLink("Back to Employee Details", ActionConst.Users.ViewEmployee, new { id = Model.EmpId })</div>
    <div class="spacer">
    </div>
</div>
<div id="modal_dialog" style="background: none repeat scroll 0 0 #EEEEEE">Do you want to activate this employee?</div>

<script type="text/javascript">

    $(document).ready(function () {
        $("#btnActivate").button();
    });
    
    $("#modal_dialog").dialog({
        resizable: false,
        height: 140,
        width: 400,
        modal: true,
        autoOpen: false,
        title: 'Activate Confirmation',
        buttons: {
            "Yes": function () {
                $(this).dialog("close");
                //window.location = deleteLinkUrl;
                $("form:last").submit();
            },
            "No": function () {
                $(this).dialog("close");

            }
        }
    });
    $("#btnActivate").live("click", function (e) {
        e.preventDefault();
        $("#modal_dialog").dialog('open');
    });
</script>
